package com.yuxer.mybatisplus.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yuxer.mybatisplus.utils.DateUtils;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * @author 糖醋🐟
 * @since 2025/6/15-上午10:25
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Entity(name = "test_1") // 指定数据表名字
@TableName("test_1") // 指定数据表名字
public class LongTest extends Model<LongTest> {
    /**
     * Long - 整数数字类型
     */
    @Id
    @TableId(value = "id", type = IdType.AUTO)// AUTO-自动生成主键
    private Long id;

    /**
     * String - 字符串类型 '123445'
     *
     */
    // 视觉资产
    @Column(name = "avatar")
    @Schema(description = "品牌头图，宣传图，格式json的[\"SysFile.id\",\"SysFile.id\"]")
    @TableField("avatar")
    private String avatar;

    @Column(name = "logo_url")
    @Schema(description = "LOGO（图标用）")
    @TableField("logo_url")
    private String logoUrl;

    @Column(name = "brands_name", unique = true)
    @TableField("brands_name")
    @Schema(description = "品牌名称")
    private String brandsName;

    @Column(name = "brands_en_name")
    @TableField("brands_en_name")
    @Schema(description = "品牌英文名称")
    private String brandEnName;

    @Column(name = "initial_letter")
    @TableField("initial_letter")
    @Schema(description = "品牌首字母索引，由系统自动更新")
    private String initialLetter;

    @Column(name = "brands_desc")
    @TableField("brands_desc")
    @Schema(description = "品牌描述")
    private String brandsDesc;

    @Column(name = "category_ids")
    @TableField("category_ids")
    @Schema(description = "品牌关联分类ids，后期自动计算进去")
    private String categoryIds;

    @TableField(value = "status", fill = FieldFill.INSERT)
    @Schema(description = "状态，0-未审核，1-审核过可用，99-已废弃")
    private Integer status;

    @Column(name = "add_datetime")
    @TableField(value = "add_datetime", fill = FieldFill.INSERT)
    @JsonFormat(pattern = DateUtils.FORMAT_PATTERN_ALL_DASH, timezone = DateUtils.TIME_ZONE_NUM)
    @Schema(description = "创建时间")
    private LocalDateTime addDateTime;

    @Column(name = "upd_datetime")
    @TableField(value = "upd_datetime", fill = FieldFill.UPDATE)
    @JsonFormat(pattern = DateUtils.FORMAT_PATTERN_ALL_DASH, timezone = DateUtils.TIME_ZONE_NUM)
    @Schema(description = "更新时间")
    private LocalDateTime updDateTime;
}
